﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Data.Entity.Core.Objects;
using System.Data.Entity.Infrastructure;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Northwind.Domain;

namespace Ex03
{
    class Program
    {
        static void Main(string[] args)
        {
            // LINQ to SQL lets you precompile queries so that you pay the cost of translating
            // the query from LINQ into SQL only once. In LINQPad the typed DataContext is
            // called TypeDataContext, so we proceed as follows:
            var db = new NorthwindEntities();
            //var cc = CompiledQuery.Compile<NorthwindEntities,decimal,IEnumerable<Customer>((ct,minPrice) =>
            // ct.Customers.Where(c => c.Purchases.Any(p => p.Price > minPrice)));

            //cc(db, 100).Dump("Customers who spend more than $100");
            //cc(this, 1000).Dump("Customers who spend more than $1000");
        }
    }
}
